//
//  ToyConfig'.swift
//  SevenAISDK
//
//  Created by 七块 on 2025/7/3.
//

import Foundation

/// 设备连接状态
public enum DeviceConnectStatus:Int {
    /// 未连接
    case DISCONNECTED = 0
    /// 连接
    case CONNECTED = 1
}
/// 设备控制指令
public enum ToyControlCommand:Int,CaseIterable {
    /// 开始工作
    case START_WORK = 0
    /// 停止工作
    case STOP_WORK = 1
    /// 快一点
    case FASTER = 2
    /// 慢一点
    case SLOWDOWN = 3
    /// 声音加大
    case VOLUME_UP = 4
    /// 声音减小
    case VOLUME_DOWN = 5
}
/// 马达类型
public enum MotorType:Int,Codable{
    /// 振动
    case VIBRATOR = 0
    /// 伸缩
    case SCALE
    /// 吮吸
    case SUCK
    /// 摇杆
    case ROCKER
    /// 正反转
    case FORREV
    /// 旋转
    case ROTATE
    /// 舌舔
    case LICKING
    /// 拍打
    case SLAP
    /// 电击
    case ELECT
    /// 气泵
    case AIR_PUMP
    /// 未知
    case UNKNOWN
}
/// 玩具指令回调
public enum SevenBlockToyListener{
    /// 响应设备控制指令
    case onToyControlCommand(command:ToyControlCommand)
    /// 发起连接设备的请求，
    case requestConnectDevice
}
/// 设备信息
public struct DeviceInfo:Codable{
    /// 蓝牙名称
    public var btName:String
    /// 设备SN号
    public var deviceSn:String
    /// 是不是真蓝牙设备
    public var isBleDevice:Bool
    /// 马达类型
    public var motorTypes:[MotorType]
    
    public init(btName: String, deviceSn: String, isBleDevice: Bool, motorTypes: [MotorType]) {
        self.btName = btName
        self.deviceSn = deviceSn
        self.isBleDevice = isBleDevice
        self.motorTypes = motorTypes
    }
}

